package com.cgbl.service.pop

import android.content.Context
import android.view.View
import com.cgbl.service.R
import com.lxj.xpopup.core.BottomPopupView

class SelectJobStatusPop(
    context: Context, private val onSelectListener: (status: Int) -> Unit
) : BottomPopupView(context) {

    override fun getImplLayoutId(): Int {
        return R.layout.app_pop_select_job_status
    }

    override fun initPopupContent() {
        super.initPopupContent()
        findViewById<View>(R.id.ll_offline).setOnClickListener {
            onSelectListener.invoke(STATUS_OFFLINE)
            dismiss()
        }
        findViewById<View>(R.id.ll_online).setOnClickListener {
            onSelectListener.invoke(STATUS_ONLINE)
            dismiss()
        }
    }

    companion object {
        const val STATUS_ONLINE = 0

        const val STATUS_OFFLINE = 1

    }
}